home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Science
/
RLaB
/
rlib
/
tmp_file.r
< prev
next >
Wrap
Text File
|
1994-04-25
|
936b
|
38 lines
//-------------------------------------------------------------------//
// Syntax: tmp_file ( )
// Description:
// The tmp_file function generates a string, which can be used as a
// temporary file name. The tmp_file function generates the file name
// with the help of the system's date program. If your particular
// platform does not support the date usage as delivered, then modify
// the argument to system() to get the correct effect.
//-------------------------------------------------------------------//
static (K); // to help insure unique name during a session
K = 1;
tmp_file = function ( )
{
local (ans, k, pfile, sans);
//
// Generate a date string that looks like hhmmss. That is
// numerical hour, minutes, seconds.
//
pfile = "|date +%H%M%S";
ans = getline (pfile);
close (pfile);
sprintf (sans, "%i", ans.[1]);
sprintf (k, "%i", K);
K++;
return "rlab-" + sans + "." + k;
};